package com.szxy.json;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.junit.jupiter.api.Test;

import java.util.Date;

/**
 * @Author:zwer
 * @Date:2020/4/14 23:37
 * @Description:com.szxy.json
 * @Version:1.0
 **/
public class Stu {
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date  dd;

    public Stu(Date dd) {
        this.dd = dd;
    }

    public Stu() {
    }

    public Date getDd() {
        return dd;
    }

    public void setDd(Date dd) {
        this.dd = dd;
    }
}


class  Test1 {

    @Test
    public void test() {
        Stu stu = new Stu(new Date());
        String str = JsonUtils.objectToJson(stu);
        System.out.println(str);
    }
}